
public class BooleanColorPainter {
	private int rows;
	private int cols;
	
	public BooleanColorPainter(){
		
	}
	
	public boolean[][] paint(boolean [][] array,int row, int column,boolean color){
		this.rows=array.length;
		if(!(rows>0)||array[0]==null){
			return array;
		}
		this.cols=array[0].length;
		
		if(row<0 || row>rows || column<0 || column>cols){
			return array;
		}
		
		return recPaint(array,row,column,color);
	
	}

	private boolean[][] recPaint(boolean[][] array,int row,int column,
			boolean color) {
		
		paintLine(array,row-1,column,color);
		paintLine(array,row,column,color);
		paintLine(array,row+1,column,color);
		
		return null;
	}

	private void paintLine(boolean[][] array, int row, int column, boolean color) {
		if(row<0 || row>rows){
			return;
		}
		
		for(int j=-1;!(column+j<0) && column+j<cols;j++){
			if(array[row][j]!=color){
				array[row][j]=color;
				recPaint(array,row,j,color);
			}
			else{
				return;
			}
		}
	}
	
	
	
}
